<template>
    <div class="page">
        <div class="header">
            <div class="headerContent">
                <div>Hi，欢迎来到工程5188信息共享平台！</div>
                <div class="flex-start">
                    <div @click="$router.push('/')" style="cursor: pointer;">工程5188首页</div>
                    <div class="m-l-36" @click="$router.push('/vipCenter')" style="cursor: pointer;">服务中心</div>
                </div>
            </div>
        </div>
        <div class="headerData">
            <div class="headerData-content">
                <div class="headerData-content-company">
                    <img :src="detailData.company_logo_url" alt="">
                    <div class="headerData-content-div">
                        <div class="headerData-content-div-name">
                            <div>{{ detailData.company_name }}</div>
                            <img class="shiliIcon" v-if="detailData.is_strength" src ="@/static/engineering5188/company/shili.png" alt="">
                            <img class="realIcon"  v-if="detailData.is_verify" src ="@/static/engineering5188/company/real.png" alt="">
                        </div>
                        <div class="headerData-content-zhuying">
                            <img class="zhuyingIcon" src ="@/static/engineering5188/company/zhuying.png" alt="">
                            <div class="zhuyingname">主营：</div>
                            <div class="zhuyingnametext">{{ detailData.company_products }}</div>
                        </div>
                    </div>
                </div>

                <div class="headerData-content-right">
                    <img class="telIcon" src="@/static/engineering5188/company/tel.png" alt="">
                    <div>
                        <div class="headerData-content-right-name">全国服务热线</div>
                        <div  class="headerData-content-right-num">{{ detailData.mobile }}</div>
                    </div>
                </div>
            </div>
        </div>

        

        <div class="company-lunbo">
            <div  class="company-lunbo-content">
                <el-carousel  type="card" height="416px" arrow="always">
                  <el-carousel-item v-for="item in carouselList">
                    <img class="lunboClass" :src="item.image_url" alt="">
                  </el-carousel-item>
                  
                </el-carousel>
            </div>
        </div>
        <div class="company-navigate">
            <div class="company-navigate-div">
                <div class="company-navigate-left">
                    <img src="@/static/engineering5188/company/home.png" alt="">
                    <div>
                        工程5188 >  {{ detailData.company_name }}
                    </div>
                </div>
                <div class="company-navigate-right">
                    <img  src="@/static/engineering5188/company/search.png" alt="">
                    <input type="text" v-model="searchTxt" placeholder="请输入需要搜索的内容" class="cascaderClass" ></input>
                    <div class="btn" @click="searchFunc">搜索</div>
                </div>
            </div>
        </div>

        <router-view></router-view>
        
    </div>
</template>

<script>
import { mapState } from "vuex";
export default {
    computed: {
        ...mapState([
            "userInfo",
        ]),
    },
    data() {
        return {
            detailData: {},
            carouselList:[],
            searchTxt:''
        }
    },
    created(){
        this.getDetail();
        this.showBanner();
    },
    methods: {
        showBanner(){
          this.$httpApi("/api/getBanner", {
              position:1
            },
             "get"
          )
            .then((res) => {
              this.carouselList = res.data;
            });
        },
        getDetail(){
            console.log(this.$route,'this.$router.query');
            this.$httpApi("/api/getShopDetail", {
                shop_id: this.$route.query.shop_id
            }, "get").then(res =>{
                this.detailData = res.data;
            })
        },
        searchFunc(){
            this.$router.push({
                path: '/companyInfo/product',
                query: {
                    shop_id: this.$route.query.shop_id,
                    searchTxt: this.searchTxt,
                }
            });
        }
        
    },
}
</script>

<style scoped lang="less">
.page {
    width: 100%;
    height: 100%;
    background-color: #F6F6F6;

    .header {
        width: 100%;
        height: 36px;
        background: #F6F6F6;
    }

    .headerContent {
        width: 1200px;
        height: 100%;
        margin: 0 auto;
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-family: PingFang SC, PingFang SC;
        font-weight: 400;
        font-size: 14px;
        color: #333333;
    }

    .flex-start {
        display: flex;
        align-items: center;
    }

    .m-l-36 {
        margin-left: 36px;
    }

    .headerData{
        background: #FFFFFF;
        height: 100px;

        .headerData-content{
            width: 1200px;
            margin: 0 auto;
            display: flex;
            align-items: center;
            justify-content: space-between;
            height: 100%;

            img {
                width: 120px;
                height: 74px;
            }
            .headerData-content-div{
                margin-left: 20px;
            }
            .headerData-content-div-name{
                font-weight: bold;
                font-size: 24px;
                color: #000000;
                display: flex;
                align-items: center;
                

                .shiliIcon{
                    width: 56px;
                    height: 20px;
                    margin-left: 12px;
                }
                .realIcon{
                    width: 104px;
                    height: 20px;
                    margin-left: 12px;
                }
            }

            .zhuyingIcon{
                width: 12px;
                height: 12px;
                margin-right: 10px;
            }
            .zhuyingname{
                color: #858585;
                font-weight: 400;
                font-size: 14px;
            }
            .zhuyingnametext{
                width: 380px; /* 限制宽度 */
                white-space: nowrap; /* 防止换行 */
                overflow: hidden; /* 隐藏溢出的内容 */
                text-overflow: ellipsis; /* 显示省略号 */
            }
            .headerData-content-zhuying{
                display: flex;
                align-items: center;
                margin-top: 12px;
            }
            .headerData-content-company{
                display: flex;
            }
        }

        
        .headerData-content-right-name{
            font-weight: 400;
            font-size: 16px;
            color: #666666;
            margin-left: 16px;
        }
        .headerData-content-right-num{
            font-weight: 400;
            font-size: 18px;
            color: #333333;
            margin-left: 16px;
        }
        .headerData-content-right{
            display: flex;
            .telIcon{
                width: 40px;
                height: 40px;
            }
        }
    }

    .company-nav{
        height: 48px;
        background: #000000;
    }
    .company-nav-div{
        width: 1200px;
        margin: 0 auto;
        display: flex;
        justify-content: space-around;
        .company-nav-div-name{
            font-weight: 500;
            font-size: 16px;
            color: #31A41B;
            line-height: 45px;
            border-bottom: 3px solid #31A41B;
            cursor: pointer;
        }
        .company-nav-div-name-no{
            font-weight: 400;
            font-size: 16px;
            color: #FFFFFF;
            line-height: 45px;
            cursor: pointer;
        }
    }

    .company-lunbo{
        height: 488px;
        background: #EAEAEA;
        display: flex;
        align-items: center;

        .company-lunbo-content{
            width: 1200px;
            margin: 0 auto;

            .lunboClass{
               width: 680px;
               height: 416px; 
            }

            
        }
    }

    .company-navigate{
        height: 60px;
        background: #FFFFFF;
        font-weight: 400;
        font-size: 14px;
        color: #000000;
        display: flex;
        align-items: center;

        .company-navigate-left{
            display: flex;
            align-items: center;

            img{
                width: 14px;
                height: 14px;
                margin-right: 12px;
                
            }

        }
    }

    .company-navigate-right{
        display: flex;
        // width: 246px;
        height: 32px;
        border: 2px solid #333333;
        align-items: center;
        img{
            width: 12px;
            height: 10px;
            margin-left: 10px;
            margin-right: 10px;
        }
        input {
            width: 176px;
        }
        .btn{
            width: 70px;
            height: 32px;
            background: #333333;
            font-weight: 500;
            font-size: 14px;
            color: #FFFFFF;
            line-height: 32px;
            text-align: center;
            flex-basis: 70px;
            flex-grow: 0;      /* 禁止放大 */
            flex-shrink: 0;    /* 禁止缩小 */
            cursor: pointer;
        }
    }

    .company-navigate-div{
        width: 1200px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin: 0 auto;
    }
    
}
</style>


